<?php

return [
    'models' => [
        'user' => Caifenglei\AuthRbac\Models\User::class
    ],

    'routes' => [
        'prefix' => 'api/v1'
    ],

    /**
     * 统一认证配置
     */
    'sso' => [
        'client_id' => env('SSO_CLIENT_ID', 'xxx'),
        'client_secret' => env('SSO_CLIENT_SECRET', 'xxxxxx'),
        'server_host' => env('SSO_AUTH_SERVER_HOST', 'http://sso.teach.com'),
        'redirect_uri' => env('SSO_CLIENT_REDIRECT_URI', 'http://client.teach.com/oauth/callback'),
        'mobile_redirect_uri' => env('SSO_CLIENT_MOBILE_REDIRECT_URI', 'http://client.teach.com/mobile/oauth/callback'),
        'authorize_url' => env('SSO_AUTH_AUTHORIZE_URL', 'http://sso.teach.com/oauth/authorize'),
        'token_url' => env('SSO_AUTH_TOKEN_URL', 'http://sso.teach.com/oauth/token'),
        'logout_url' => env('SSO_AUTH_LOGOUT_URL', 'http://sso.teach.com/logout'),
        'mobile_logout_url' => env('SSO_AUTH_MOBILE_LOGOUT_URL', 'http://sso.teach.com/mobile/logout'),
        'profile_version' => env('SSO_AUTH_PROFILE_VERSION', 'self'),
    ],

    //用户密码配置
    'passwords' => [
        'init' => [
            'prefix' => 'xxjy@',
            'suffix' => '!'
        ]
    ],

    //角色关联对象的查询字段
    'role_permission_fields' => ['id', 'name', 'label', 'type', 'parent_id'],
    'role_user_fields' => ['id', 'name', 'username', 'gender'],

    'middlewares' => [
        'record_log' => \Caifenglei\AuthRbac\Http\Middleware\RecordLog::class
    ],

    //是否开启接口鉴权
    'api_auth_enabled' => true,

    /**
     * 免鉴权的路由（name）白名单，只需登录，即可调用的接口路由
     */
    'authorized_free_routes' => [
        'admin.permissions.granted',
        'common.file.upload',
        'common.file.delete',
        'base.dict.types',
        'base.dict.data'
    ]
];
